package com.chainyoung.component_tmperson.ui.mvp.model;

import com.chainyoung.common.appcommon.db.DbConstant;
import com.chainyoung.common.appcommon.hdwallet.EtherscanService;
import com.chainyoung.common.exception.ApiException;
import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.mvp.BaseModel;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.component_tmperson.api.PersonService;
import com.chainyoung.component_tmperson.constant.PersonSystemConstant;
import com.chainyoung.component_tmperson.entity.BookMark;
import com.chainyoung.component_tmperson.entity.BrowseCache;
import com.chainyoung.component_tmperson.entity.CheckBookMarkResult;
import com.chainyoung.component_tmperson.ui.mvp.contract.BrowserHistoryContract;
import com.chainyoung.component_tmperson.ui.mvp.contract.OtheAppSendTransactionContract;
import com.chainyoung.component_tmperson.ui.mvp.model.dao.BrowseDAO;

import org.json.JSONObject;

import java.util.List;
import java.util.TreeMap;

import javax.inject.Inject;

import io.reactivex.Flowable;
import io.reactivex.annotations.NonNull;
import io.reactivex.functions.Function;
import okhttp3.ResponseBody;

public class BrowserHistoryModel  extends BaseModel implements BrowserHistoryContract.Model {

    private BrowseDAO DAO = new BrowseDAO(mRepositoryManager.obtainRealmConfig(DbConstant.DB_NAME));


    @Inject
    BrowserHistoryModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);

    }



    @Override
    public Flowable<Boolean> delSingleBrowserHistory(String time, String url) {
        return DAO.deleteScheduleCacheByUrl(time,url);
    }

    @Override
    public Flowable<Boolean> delAllBrowserHistory() {
        return DAO.deleteScheduleCacheAll();
    }
}


